package com.fyh.feign;

import com.fyh.entity.common.Result;
import com.fyh.entity.job.DeliveryRecord;
import com.fyh.entity.user.SimpleCandidate;
import com.fyh.feign.fallback.EmployerUserFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-user", fallback = EmployerUserFeignClientFallback.class, path = "/user")
public interface EmployerUserFeignClient {
    /**
     * 获取用户昵称
     *
     * @param id
     * @return
     */
    @GetMapping("/getNickname")
    Result<String> getNickname(@RequestParam("userId") Long id);

    /**
     * 获取招聘者基础信息列表
     *
     * @param deliveryRecordList
     * @return
     */
    @PostMapping("/getSimpleCandidateList")
    Result<List<SimpleCandidate>> getSimpleCandidateList(@RequestBody List<DeliveryRecord> deliveryRecordList);

    /**
     * 获取招聘者基础信息
     *
     * @param userId
     * @return
     */
    @GetMapping("/getSimpleCandidate")
    Result<SimpleCandidate> getSimpleCandidate(@RequestParam("userId") Long userId);
}
